package com.yixun.qfbao.api.service.login;

import com.yixun.qfbao.util.SpringContextUtil;
import org.apache.commons.lang.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zilong.liu
 * @date 2020-7-31
 * @desc
 *
 */
public class LoginFactory {
	
	//系统编码和对应的登录beanName的map
	private static final Map<String, String> map = new HashMap<>();
	
	static {
		map.put("7", "weappLoginService");
	}
	
	/**
	 * 根据系统ID获取对应的loginService
	 * @param loginType
	 * @return
	 */
	public static BaseLoginService getLoginService(String loginType) {
		String beanName = map.get(loginType);
		if(StringUtils.isBlank(beanName)) {
			return null;
		}
		return SpringContextUtil.getBean(beanName);
	}
}
